<?php

####################### Atvaizduojam panele ###########################
if (!defined("LEVEL") || !isset($_SESSION['username']) || empty($_SESSION['username'])) {
	$text = <<<HTML
	<center>
		<form id="user_reg" name="user_reg" method="post" action="">
			<label for="vartotojas">Vartotojas:</label><br/>
			<script>document.write('<input name="vartotojas" id="vartotojas" type="text" value="" maxlength="50" />');</script><br/>
			<label for="slaptazodis">Slaptažodis:</label><br/>
			<input name="slaptazodis" id="slaptazodis" type="password" value="" maxlength="50" /><br/>
			<input type="checkbox" style="background-color:transparent;border:0" name="Prisiminti" id="Prisiminti"  title="header=[Pagalba] body=[<br/>Pažymėkite šį laukelį jei norite,<br/> kad sistema Jus prisimintų. <p><i>Tokiu atveju nereikės kaskart įvedinėti slaptažodžio</i></p>] fade=[on]"/> <input type="submit" name="Submit" value="Prisijungti" />
			<input type="hidden" name="action" value="prisijungimas" />
		</form>
	</center>
HTML;
	if ($conf['Registracija'] == 1) { $text .= "<a href=\"?id,41\">Registracija</a> "; }
	$text .= "<a href=\"?id,42\">Pamiršau</a>";
	$title = "Vartotojams";
}
else {
	$pm = mysql_fetch_assoc(mysql_query1("SELECT count(id) AS `total` FROM `".LENTELES_PRIESAGA."private_msg` WHERE `to`=".escape($_SESSION['username'])." AND `read`='NO'"));
	$user = mysql_fetch_assoc(mysql_query1("SELECT * FROM `".LENTELES_PRIESAGA."users` WHERE `nick`=".escape($_SESSION['username'])." LIMIT 1"));
	if ($pm['total'] != 0) { $img = "<blink><img src='images/icons/email_error.gif' alt='new' border='0' style=\"vertical-align: middle;\"/></blink>"; }
	else { $img = "<img src='images/icons/email.png' alt='@' border='0' style=\"vertical-align: middle;\"/>"; }

	$text = "
		<ul>
			<li><a href=\"?id,44\"><img src=\"images/icons/user_edit.png\" alt=\"@\" style=\"vertical-align: middle;\" border=\"0\"> Redaguoti profilį</a></li>
			<li><a href=\"?id,45\">$img Žinutės</a></li>
			<li><a href=\"?id,43\"><img src=\"images/icons/key_go.png\" alt=\"@\" style=\"vertical-align: middle;\" border=\"0\"> Atsijungti</a></li>
		</ul>
	";

	if (defined("LEVEL") && LEVEL == 30) {
		$text .= "
		<ul>
			<li><a href=\"?id,46\"><img src=\"images/icons/server_key.png\" alt=\"@\" style=\"vertical-align: middle;\" border=\"0\"> Administravimas</a></li>
			<li><a href=\"?id,46;a,2\"><img src=\"images/icons/user.png\" alt=\"@\" style=\"vertical-align: middle;\" border=\"0\"> Rašyti naujieną</a></li>
		</ul>";
	}
	$title = "Labas ".$_SESSION['username'];
}
?>
